import axios from 'axios'

export const startSession = (sessionData) => {
  // 确保数据格式与后端 SessionStart schema 匹配
  return axios.post('/sessions/start', sessionData)
}

export const endSession = (sessionId) => {
  return axios.post('/sessions/end', { session_id: sessionId })
}

export const getActiveSessions = () => {
  return axios.get('/sessions/active')
}

// 获取历史会话接口
export const getHistorySessions = (skip = 0, limit = 100) => {
  return axios.get(`/sessions/history?skip=${skip}&limit=${limit}`)
}

// 获取学生会话记录
export const getStudentSessions = (studentId) => {
  return axios.get(`/sessions/students/${studentId}/sessions`)
}